import os
from .error_massage import ErrorMssage

mode=os.getenv('SANIC_ENV','DEV')

def load_configs():
    try:
        if mode=='PRD':
            from .configs_product import PRD as CONFIG
            return CONFIG
        else:
            from .configs_dev import DEV as CONFIG
            return CONFIG
    except ImportError:
        from .configs_dev import DEV as CONFIG
        return CONFIG
def load_celery_configs():
    try:
        if mode == 'PRD':
            from .configs_product import CeleryConfig_Prd
            return CeleryConfig_Prd
        else:
            from .configs_dev import CeleryConfig_Dev
            return CeleryConfig_Dev
    except ImportError:
        from .configs_dev import CeleryConfig_Dev as celery_config
        return celery_config


CONFIG = load_configs()
CELERY_CONFIG = load_celery_configs()